package org.example.curriculum_design_6_16.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.example.curriculum_design_6_16.entity.pojo.Student;
import org.example.curriculum_design_6_16.service.StudentService;
import org.example.curriculum_design_6_16.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 郑凯
* @description 针对表【student】的数据库操作Service实现
* @createDate 2025-06-16 09:26:01
*/
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student>
    implements StudentService{

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Student getStudentById(String id) {
        return baseMapper.selectById(id);
    }

    @Override
    public List<Student> getStudentGrade(Integer grade) {
        return studentMapper.selectStudentByGrade(grade);
    }

    @Override
    public Student getStudentGradeById(String id, Integer grade) {
        return studentMapper.selectStudentByGradeAndId(id, grade);
    }
}




